#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/12/6 9:09
# @Author  : lizhen
# @Site    : 
# @File    : count.py
# @Software: PyCharm
from datetime import datetime
from time import time


def count_time(func_out):
    def wrapper(*args, **kwargs):
        start = time()
        func_out(*args, **kwargs)
        end = time()
        print(end - start)

    return wrapper


@count_time
def t_func():
    j = 0
    for i in range(100000):
        j += 1


def count_day():
    dates = datetime.now().strftime('%Y-%m-%d').split('-')
    day_of_month = dates[2]
    day_of_week = datetime.now().weekday() + 1
    day_of_year = datetime(int(dates[0]), int(dates[1]), int(dates[2])).strftime('%j')
    print(day_of_year, day_of_month, day_of_week)


def count_result():
    a = [0, 1]
    i = 0
    i, a[i] = 1, 2
    assert a == [0, 2]
    g = lambda x, y, z=10: x + y * z
    assert g(1, 2) == 21


def main():
    # t_func()
    # count_day()
    count_result()


if __name__ == '__main__':
    main()
